/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import pojo.Tinhtrangsanpham;
import util.HibernateUtil;

/**
 *
 * @author WMThiet
 */
public class TinhTrangSanPhamDAO {
    public static List<Tinhtrangsanpham> LayDSTinhTrang(){
        Session session = HibernateUtil.getSessionFactory().openSession();
        List<Tinhtrangsanpham> listTT = null;
        try{
            
            String hql = "from Tinhtrangsanpham tt";
            Query query = session.createQuery(hql);
            listTT = query.list();
            
        }catch(Exception e){
            listTT = null;
        }finally{
            session.close();
        }
        
        return listTT;
    }
}
